﻿#ifndef SERIAL_H
#define SERIAL_H

#include <QObject>
#include <QSerialPort>
#include <QSerialPortInfo>
#include <QDebug>
#include <QMessageBox>

class Serial : public QObject
{
    Q_OBJECT
public:
    Serial();
    ~Serial();
public slots:
    void OpenSerial(const QString PortName,
                    const qint32 BaudRate,
                    const qint8 DataBits,
                    const qint8 StopBits,
                    const qint8 Parity,
                    const qint8 FlowControl);
    void CloseSerial();
    void SerialWrite(const QByteArray& data);
    void SerialRead();
signals:
    void recive(const QByteArray& content);
private:
    QSerialPort * objSerial;

};

#endif // SERIAL_H
